﻿<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Blazing.BusinessObjects" namespace="Blazing.BusinessObjects.Cms" >
	<class name="Menu" table="menus" dynamic-insert="true" dynamic-update="true">

		<id name="ID" column="menuid" type="Int32">
			<generator class="native" />
		</id>
		<timestamp column="rowstamp" name="RowStamp" />

		<property name="Name" length="100" not-null="true" />
		<property name="Description" length="300" />
		<property name="Prefix" length="30" />

		<many-to-one name="Site" column="siteid" class="Site" not-null="true" />
		<many-to-one name="MenuType" column="menutypeid" class="MenuType" not-null="true" />

		<set name="ChildItems" where="parentid is null" >
			<key column="menuid" />
			<one-to-many class="MenuItem" />
		</set>

    <set name="MenuTaxonomyTags" table="menutaxonomytags">
      <key column="ID"/>
      <many-to-many class="Blazing.BusinessObjects.Tagging.TaxonomyTag" column="taxonomytagid"/>
    </set>
		
	</class>
</hibernate-mapping>
